<?php
function login() { 
echo 
"<table width=\"250\" border=\"0\" align=\"right\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#CCCCCC\">
<tr>
<form name=\"form1\" method=\"post\" action=\"check_login.php\">
<td>
<table width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=\"#AAAAAA\">
<tr>
<td width=\"70\"><label>Username</label></td>
<td width=\"5\"></td>
<td width=\"300\"><input name=\"myusername\" type=\"text\" id=\"myusername\"
value = \"Username\"; onfocus=\"if(this.value==this.defaultValue) this.value='';\"; ></td>
</tr>
<tr>
<td><label>Password</label></td> 
<td></td>
<td><input name=\"mypassword\" type=\"password\" id=\"mypassword\"
value = \"Password\"; onfocus=\"if(this.value==this.defaultValue) this.value='';\";  ></td>
<td></td>
</tr>
<tr>
<td><input type=\"button\" name=\"Register\" value=\"Register\" onclick=\"location = 'login_form.php';\" class=\"btn btn-mini btn-block btn-primary\"></td>
<td>   <label>or</label>     </td>
<td><input type=\"submit\" name=\"Submit\" value=\"Log In\" class=\"btn btn-mini btn-block btn-primary\"></td>
</tr>
</table>
</td>
</form>
</tr>
</table>
";

}
function logout() {
echo	
"<table width=\"350\" border=\"0\" align=\"right\" cellpadding=\"10\" cellspacing=\"1\" bgcolor=\"#CCCCCC\">
<tr>
<form name=\"form1\" method=\"post\" action=\"logout.php\">
<td>
<div class=\"btn-group\">
<a class=\"btn dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">
Action
<span class=\"caret\"></span>
</a>
<ul class=\"dropdown-menu\">
<li><input type=\"button\" name=\"postbook\" value=\"Post a book\" onclick=\"location = 'postbook.php';\" class=\"btn btn-small btn-block btn-link\"></li>
<li><input type=\"submit\" name=\"Submit\" value=\"Logout\" class=\"btn btn-small btn-block btn-link\"></li>
</ul>
</div>
</td>
<td><p class=\"lead\"><strong>Welcome,  </strong>";
echo $_SESSION['myusername']; 
echo "</p></td>
<td>&nbsp;</td>
</tr>
</table>
</td>
</form>
</tr>
</table>
";
}
?>